package controller;

import java.util.HashMap;

import project_package.*;

public class CustomerController {

	CustomerRecords customerRecordsCtrl;
	private static CustomerController instance = null;
	
	public static CustomerController getInstance()
    {
    	if(instance == null)
    	{
    		instance = new CustomerController();
    	}
    	return instance;
    }
	
	public CustomerController() 
	{
		customerRecordsCtrl = CustomerRecords.getInstance();
	}
	
	public boolean createCustomer(String name, String phoneNo, String address, long civilNum, double discount, boolean isBusiness)
	{
		return customerRecordsCtrl.createCustomer(name, phoneNo, address, civilNum, discount, isBusiness);
	}
	
	public boolean updateCustomer(int id, String name, String phoneNo, String address, long civilNum, long datestamp, double discount, boolean isBusiness)
	{
		return customerRecordsCtrl.updateCustomer(id, name, phoneNo, address, civilNum, datestamp, discount, isBusiness);
	}
	
	public boolean deleteCustomer(String name)
	{
		return customerRecordsCtrl.deleteCustomer(name);
	}
	
	public Customer findCustomer(String name)
	{
		Customer customer = customerRecordsCtrl.findCustomer(name);
		return customer;
	}
		
	public void printCustomers()
	{
		customerRecordsCtrl.printCustomers();
	}
		
	public HashMap<Integer, Customer> getCustomers() {
		return customerRecordsCtrl.getCustomers();
	}
	
	
	public int getCustomersNumber()
	{
		int customersNumber = customerRecordsCtrl.getCustomersNumber();
		return customersNumber;
	}
}